#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.63])
AC_INIT([Online Hierarchical Storage Manager], [Version 1.1.1], [fscops@googlegroup.com])
AC_CONFIG_SRCDIR([parse_reloc_file.c])
AC_CONFIG_HEADERS([config.h])

# Checks for programs.
AC_PROG_CC

# Checks for libraries.

# Checks for header files.
AC_CHECK_HEADER([libdevmapper.h],,AC_MSG_ERROR([libdevmapper missing on system. Install libdevmapper to proceed.]))
AC_CHECK_HEADERS([fcntl.h langinfo.h locale.h stdint.h stdlib.h string.h sys/ioctl.h sys/param.h unistd.h])

# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_UID_T
AC_CHECK_MEMBERS([struct stat.st_rdev])
AC_TYPE_UINT64_T

# Checks for library functions.
AC_FUNC_MALLOC
AC_CHECK_FUNCS([memset strtol strtoul])

AC_CONFIG_FILES([Makefile])

AC_PATH_PROGS([PACKAGE_CONFIG], [pkg-config], [none])
if test "x$PACKAGE_CONFIG" = "xnone"; then
 AC_MSG_ERROR([*** pkg-config required to check for libxml2 existence is missing.])
fi

AC_MSG_CHECKING(for libxml2)

if $PACKAGE_CONFIG libxml-2.0 --libs > /dev/null 2>&1; then
 AC_MSG_RESULT(yes)
else
 AC_MSG_RESULT(no)
 AC_MSG_ERROR([*** libxml2 missing on the system. Install libxml2 to proceed.])
fi

AC_OUTPUT
